﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class settings : Form
    {
        public settings()
        {
            InitializeComponent();
        }
        public Form backForm { get; set; }
        string Keychar = string.Empty;

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {

                Properties.Settings.Default["gameBGHide"] = true;
                Properties.Settings.Default.Save();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            backForm.Visible = true;

            this.Hide();
        }

        private void settings_Load(object sender, EventArgs e)
        {
            FormBorderStyle = FormBorderStyle.None;
            WindowState = FormWindowState.Maximized;
            this.KeyPreview = true;
            backForm.Visible = true;
            this.Hide();
        }

        private void settings_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (presskeylbl.Visible)
            {
                Keychar = e.KeyChar.ToString().ToUpper();
                label2.Text = Keychar;
                presskeylbl.Visible = false;
                Properties.Settings.Default["gameHotKey"] = Keychar;
                Properties.Settings.Default.Save();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            presskeylbl.Visible = true;
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            Properties.Settings.Default["gameHitSound"] = ((CheckBox)sender).Checked;
            Properties.Settings.Default.Save();
                
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            Properties.Settings.Default["gameMusic"] = ((CheckBox)sender).Checked;
            Properties.Settings.Default.Save();
        }
    }
}
